package com.fr.report.io.xml;

import com.fr.base.ColumnRow;
import com.fr.report.FineBook;
import com.fr.report.Report;
import com.fr.report.ReportSettings;
import java.util.Hashtable;

public class SynchronizedFrozenColumnRow
{
  private static Hashtable threadColumnRowList = new Hashtable();

  public static void putSynchronizedFrozenColumnRow(ColumnRow paramColumnRow)
  {
    if ((paramColumnRow != null) && (threadColumnRowList.get(Thread.currentThread()) == null))
      threadColumnRowList.put(Thread.currentThread(), paramColumnRow);
  }

  public static ColumnRow removeSynchronizedFrozenColumnRow()
  {
    return ((ColumnRow)threadColumnRowList.remove(Thread.currentThread()));
  }

  public static void flushSynchronizedFrozenColumnRow(FineBook paramFineBook)
  {
    ColumnRow localColumnRow;
    int i;
    if (paramFineBook != null)
    {
      localColumnRow = (ColumnRow)threadColumnRowList.remove(Thread.currentThread());
      if (localColumnRow != null)
        for (i = 0; i < paramFineBook.getReportCount(); ++i)
          if (paramFineBook.getReport(i) != null)
          {
            ReportSettings localReportSettings = paramFineBook.getReport(i).getReportSettings();
            if (localReportSettings == null)
            {
              localReportSettings = new ReportSettings();
              paramFineBook.getReport(i).setReportSettings(localReportSettings);
            }
            localReportSettings.setWriteFrozenColumnRow(localColumnRow);
          }
    }
  }

  public static void clear()
  {
    threadColumnRowList.clear();
  }
}